RWTH - Mindstorms NXT Toolbox

NXT_ResetInputScaledValue

Resets the sensors ScaledVal back to 0, depends on currently configured mode (see NXT_SetInputMode)

Contents

Syntax

NXT_ResetInputScaledValue(port)

NXT_ResetInputScaledValue(port, handle)

Description

NXT_ResetInputScaledValue(port) resets the sensors ScaledVal back to 0 of the given sensor port. The value port can be addressed by the symbolic constants SENSOR_1, SENSOR_2, SENSOR_3 and SENSOR_4 analog to the labeling on the NXT Brick. The ScaledVal is set by function NXT_SetInputMode.

NXT_ResetInputScaledValue(port, handle) uses the given NXT connection handle. This should be a struct containing a serial handle on a PC system and a file handle on a Linux system.

If no NXT handle is specified the default one (COM_GetDefaultNXT) is used.

For more details see the official LEGO Mindstorms communication protocol.

Note:

This function should be called after using NXT_SetInputMode, before you want to actually use your new special input value (to make sure counting starts at zero). See NXT_GetInputValues for more details about what kind of values are returned.

Examples

   NXT_ResetInputScaledValue(SENSOR_2);
   handle = COM_OpenNXT('bluetooth.ini','check');
   NXT_ResetInputScaledValue(SENSOR_4, handle);

See also

NXT_SetInputMode, NXT_GetInputValues

Signature